package com.gitee.wsl.collections.iterator.api

/**
 * Defines an iterator that operates over an ordered `Map`.
 *
 *
 * This iterator allows both forward and reverse iteration through the map.
 *
 *
 * @param <K> the type of the keys in the map
 * @param <V> the type of the values in the map
 * @since 3.0
</V></K> */
interface OrderedMapIterator<K, V> : MutableMapIterator<K, V>, OrderedIterator<K> {
    /**
     * Checks to see if there is a previous entry that can be iterated to.
     *
     * @return `true` if the iterator has a previous element
     */
    override fun hasPrevious(): Boolean

    /**
     * Gets the previous *key* from the `Map`.
     *
     * @return the previous key in the iteration
     * @throws NoSuchElementException if the iteration is finished
     */
    override fun previous(): K
}
